package com.slkj.shilixiaoyuanapp.entity;

import android.graphics.Color;

import java.util.List;

/**
 * Created  on 2018-07-31
 *
 * @author 唐开阔
 * @describe
 */
public class PunchClockHistoryEntity {


    /**
     * normal : 1
     * abnormal : 0
     * monthList : [{"state":"异常","date":"2018-08-01","dayList":[{"id":27,"time":"10:42:52","state":"异常","title":"绿地之窗"},{"id":28,"time":"13:39:04","state":"异常","title":"绿地之窗 >"},{"id":29,"time":"13:42:24","state":"异常","title":"绿地之窗 >"}]}]
     */

    private int normal;
    private int abnormal;
    private int leave;

    public int getLeave() {
        return leave;
    }

    public void setLeave(int leave) {
        this.leave = leave;
    }

    private List<MonthEntity> monthList;

    public int getNormal() {
        return normal;
    }

    public void setNormal(int normal) {
        this.normal = normal;
    }

    public int getAbnormal() {
        return abnormal;
    }

    public void setAbnormal(int abnormal) {
        this.abnormal = abnormal;
    }

    public List<MonthEntity> getMonthList() {
        return monthList;
    }

    public void setMonthList(List<MonthEntity> monthList) {
        this.monthList = monthList;
    }

    public static class MonthEntity {
        /**
         * state : 异常
         * date : 2018-08-01
         * dayList : [{"id":27,"time":"10:42:52","state":"异常","title":"绿地之窗"},{"id":28,"time":"13:39:04","state":"异常","title":"绿地之窗 >"},{"id":29,"time":"13:42:24","state":"异常","title":"绿地之窗 >"}]
         */

        private String state;
        private String date;
        private List<DayEntity> dayList;


        /**
         * 是否异常
         * @return
         */
        public boolean isYc(){
            return state.equals("异常");
        }
        /**
         * 是否是请假
         * @return
         */
        public boolean isQj(){
            return state.equals("请假");
        }
        public String getState() {
            return state;
        }

        public void setState(String state) {
            this.state = state;
        }

        public String getDate() {
            return date;
        }

        public void setDate(String date) {
            this.date = date;
        }

        public List<DayEntity> getDayList() {
            return dayList;
        }

        public void setDayList(List<DayEntity> dayList) {
            this.dayList = dayList;
        }

        public static class DayEntity {
            /**
             * id : 27
             * time : 10:42:52
             * state : 异常
             * title : 绿地之窗
             */
            private String appeal;
            private int id;
            private String time;
            private String state;
            private String title;

            public boolean isYc(){
                return state.equals("异常");
            }
            public int getId() {
                return id;
            }

            public void setId(int id) {
                this.id = id;
            }

            public String getAppeal() {
                return appeal;
            }
            public int  getAppealColor() {
                int color = 0;
                switch (appeal){
                    case  "申诉":
                        color = Color.parseColor("#999999");
                        break;
                    case  "申诉中":
                        color = Color.parseColor("#CCCCCC");

                        break;
                    case  "申诉已通过":
                        color = Color.parseColor("#0087FC");

                        break;
                    case  "申诉未通过":
                        color = Color.parseColor("#FF6953");

                        break;
                }
                return color;
            }

            public void setAppeal(String appeal) {
                this.appeal = appeal;
            }

            public String getTime() {
                return time;
            }

            public void setTime(String time) {
                this.time = time;
            }

            public String getState() {
                return state;
            }

            public void setState(String state) {
                this.state = state;
            }

            public String getTitle() {
                return title;
            }

            public void setTitle(String title) {
                this.title = title;
            }
        }
    }
}
